home *** CD-ROM | disk | FTP | other *** search
/ Apple Service Source 1996 February / Service Source 2.0 1996 Companion.iso / AppleOrder / Program / AppleOrder CCL Folder / AppleOrder USA Modem.CCL < prev    next >
Encoding:
Text File  |  1992-09-18  |  19.8 KB  |  622 lines  |  [TEXT/MPS ]

  1. !
  2. ! AppleOrder USA Modem.CCL script (NO software MNP protocol)
  3. !
  4. !    This CCL is essentially the same as the AppleLink CCL "USA Modem.CCL"
  5. !    and is intended for AppleOrder users connecting through a network which
  6. !    already has some sort of error correction, for example, a modem pool where
  7. !    all the modems are already configured for V.42/MNP connection.
  8. !
  9. !    Change History-
  10. !        v1.0        09/21/90    gs:General Release Version
  11. !        v1.0.2        12/07/90    gs:Create minor release version
  12. !        v1.1        1/11/92        gs:same as USA Software_MNP.CCL w/out MNP
  13. !        v1.2        2/12/92        gs:Cleaned up for release
  14. !
  15. !    The following label ranges (0-255) are defined for all scripts:
  16. !
  17. !    Label        Function
  18. !    -----        --------
  19. !    0-19        Communications Setup
  20. !    20-39        Get a Modem (IBX switch thru)
  21. !    40-59        Modem Setup
  22. !    60-79        Dialing
  23. !    80-99        Physical Connection
  24. !    100-119        GEIS Logon
  25. !    120-139        CICS
  26. !    140-159        APPM
  27. !    160-179        Online
  28. !    180-199        Terminate Session
  29. !    200-209        Cancel
  30. !    210-219        Hangup
  31. !    230-239        <UNUSED>
  32. !    240-255        Disconnect
  33. !
  34. !    Note:        Label 210 is the modem hangup sequence
  35. !                Label 240 is reserved as the start of the disconnect sequence
  36. !
  37. !================================================================================
  38. -LABEL 0    !***<Physical connection entry point>*** Initialize Communications
  39. !================================================================================
  40. !    Select the Serial Tool, initialize some parameters and open the session.
  41. !
  42. CDOff
  43. CTBTool "Serial Tool" 4 5
  44. CTBParameter Baud ~Baud 12
  45. CTBParameter Port "~MPrt" 13
  46. HSReset 1 0 17 19
  47. Flush
  48. !
  49. !    CTBOPEN [<LabelIfOpenFails>] [<LabelIfError>]
  50. CTBOpen 14 15        ! Open the Communications session using the CommToolBox
  51. !
  52. !    Flush any data, Initialize script variables and define Cancel label
  53. Flush                ! clear input buffer and ring buffer
  54. CanBtn 200            ! If user cancels, take the error return
  55. Jump 40                ! Go to Modem Selection and Setup
  56. !
  57. !*********
  58. -LABEL 4    !---<Serial Tool missing>---
  59. !*********
  60. Alert -1 The Serial tool cannot be found in your System folder.\13Please install it, and try again.
  61. Exit -1                ! exit the script with an error
  62. !
  63. !*********
  64. -LABEL 5    !---<CTBTool Comm Toolbox err>---
  65. !*********
  66. Alert -1 A CTBTool error has occurred in the Communications Toolbox.\13Please try again.\13If the problem continues, call the Apple USA helpline.
  67. Exit -1                ! exit the script with an error.
  68. !
  69. !*********
  70. -LABEL 12    !---<CTBParameter Baud failed>---
  71. !*********
  72. Alert -1 CTBParameter Baud caused an error.
  73. Exit -1                ! exit the script with an error.
  74. !
  75. !*********
  76. -LABEL 13    !---<CTBParameter Port failed>---
  77. !*********
  78. Alert -1 CTBParameter Port caused an error.
  79. Exit -1                ! exit the script with an error.
  80. !
  81. !*********
  82. -LABEL 14    !---<CTBOpen failed>---
  83. !*********
  84. Alert -1 CTBOpen could not open communications.\13The serial port may already be in use.
  85. Exit -1                ! exit the script with an error.
  86. !
  87. !**********
  88. -LABEL 15    !---<CTBOpen err>---
  89. !**********
  90. Alert -1 CTBOpen caused an Communications Toolbox error.
  91. Exit -1                ! exit the script with an error.
  92. !
  93. !================================================================================
  94. -LABEL 40    !***<Modem Setup>*** Modem Reset and Setup
  95. !================================================================================
  96. SetVar 1 0            ! #of consecutive no responses to hangup command
  97. SetVar 2 0            ! #of consecutive no responses to modem configuration command
  98. SetVar 3 0            ! #of consecutive network contact failures.
  99. SetVar 4 0            ! #of logon validation failures
  100. SetVar 5 0            ! #of consecutive CICS90  failures
  101. SetVar 6 0            ! #of consecutive APPM failures
  102. SetVar 7 0            ! flag to indicate if connecting(0) or disconnecting(1)
  103. SetVar 8 0            ! not used
  104. !
  105. DsplyPic 1
  106. DsplyMsg Making sure the modem is ready.
  107. Jsr 210                ! Hang up (just in case)
  108. SetVar 1 0            ! clear # hangup tries counter
  109. !
  110. !**********
  111. -LABEL 42    ! ---<Got modem attention>---
  112. !**********
  113. DsplyMsg Setting modem parameters.
  114. !    Clear all previous MatchStr's and setup the modem
  115. MatchStr 1 42 Dummy
  116. Wait 30                ! Give modem .5 second to get ready before sending AT chars
  117. Xmit ATE0X4V1\13
  118. !    Look for one of the following expected responses
  119. MatchStr 1 60 OK
  120. Wait 180               ! wait 3 secs
  121. IncVar 2            ! increment # modem setup tries
  122. IfVar 2 3 44        ! if 3 tries, display Modem Configuration Alert
  123. DsplyMsg Modem does not respond to setup commands. Retrying ...
  124. Jump 42                ! else try modem setup again
  125. !
  126. !**********
  127. -LABEL 44    ! ---<Modem configuration err>---
  128. !**********
  129. Bell
  130. Alert 200 The modem is not responding to setup commands.\13Turn the modem off and then on again before retrying.
  131. Jump 40                ! reset modem and try again
  132. !
  133. !================================================================================
  134. -LABEL 60    !***<Modem ready>*** Dial phone
  135. !================================================================================
  136. DsplyMsg Dialing ~Fone ...
  137. DsplyPic 2
  138. !    Clear all previous MatchStr's (No comments on same line as MatchStr's)
  139. MatchStr 1 60 Dummy
  140. SetVar 2 0            ! clear #modem setup tries
  141. Wait 30                ! Give modem .5 secs to get ready before sending the attention chars
  142. Xmit ATD~Tone~Fone\13
  143. !
  144. !    Look for one of the following expected responses
  145. MatchStr 1 80 ~Baud\13
  146. MatchStr 2 66 CARRIER
  147. MatchStr 3 70 BUSY
  148. MatchStr 4 74 NO DIAL
  149. MatchStr 5 62 ERROR
  150. MatchStr 6 80 1200\13
  151. MatchStr 7 80 2400\13
  152. MatchStr 8 80 4800\13
  153. MatchStr 9 80 9600\13
  154. Wait 2100            ! wait 35 secs
  155. !
  156. !**********
  157. -LABEL 62    !---<No response or ERROR from modem>---
  158. !**********
  159. IncVar 3            ! Increment # dial attempts counter
  160. IfVar 3 4 64        ! if 4 attempts, display No Dial Response Alert
  161. DsplyMsg Modem does not respond to Dial command. Retrying ...
  162. Jump 40                ! reset modem and try again
  163. !
  164. !**********
  165. -LABEL 64    !---<No dial response err>---
  166. !**********
  167. Bell
  168. Alert 200 The modem is not responding to dial command.\13Make sure your modem is connected to a phone line.
  169. Jump 40                ! reset modem and try again
  170. !
  171. !**********
  172. -LABEL 66   !---<No Carrier>---
  173. !**********
  174. IncVar 3            ! Increment # dial attempts counter
  175. IfVar 3 4 68        ! if 4 attempts, display No Carrier Alert
  176. DsplyMsg No Carrier with phone number dialed. Retrying ...
  177. Jump 40                ! reset modem and try again
  178. !
  179. !**********
  180. -LABEL 68    !---<No carrier err>---
  181. !**********
  182. Bell
  183. Alert 200 Cannot detect carrier signal after dialing.\13Make sure the phone number provided is correct.
  184. Jump 40                ! reset modem and try again
  185. !
  186. !**********
  187. -LABEL 70    !---<busy>---
  188. !**********
  189. IncVar 3            ! Increment # dial attempts counter
  190. IfVar 3 4 72        ! if 4 attempts, display Busy Alert
  191. DsplyMsg Phone number dialed is busy. Retrying....
  192. Wait 300            ! wait 5 secs
  193. Jump 40                ! reset modem and try again
  194. !
  195. !**********
  196. -LABEL 72    !---<Busy err>---
  197. !**********
  198. Bell
  199. Alert 200 All network access lines are in use.\13Try again later.
  200. Jump 40                ! reset modem and try again
  201. !
  202. !**********
  203. -LABEL 74    !---<No Dialtone>---
  204. !**********
  205. IncVar 3            ! Increment # dial attempts counter
  206. IfVar 3 4 76        ! if 4 attempts, display No Dialtone Alert
  207. DsplyMsg Modem reports no dial tone. Retrying ...
  208. Jump 40                ! reset modem and try again
  209. !
  210. !**********
  211. -LABEL 76   !---<No dialtone Error>---
  212. !**********
  213. Bell
  214. Alert 200 Modem reports no dial tone.\13Make sure your modem is connected to a phone line.
  215. Jump 40                ! reset modem and try again
  216. !
  217. !================================================================================
  218. -LABEL 80    !***<Establish Physical Connection>*** Send H's to identify us to network
  219. !================================================================================
  220. DsplyMsg Requesting network attention
  221. !    Look for one of the following expected responses
  222. MatchStr 1 84 NO CARRIER
  223. MatchStr 2 100 U#
  224. Xmit HH
  225. Wait 600            ! Allow 10 seconds for the U# to show up
  226. IncVar 3            ! No U#, increment # dial attempts counter
  227. IfVar 3 4 82        ! if 4 attempts, display No U# Alert
  228. DsplyMsg Unable to get network attention. Retrying ...
  229. Jump 80                ! try again
  230. !
  231. !**********
  232. -LABEL 82    !---<No U#>---
  233. !**********
  234. Bell
  235. Alert 200 Unable to get the network's attention.\13Make sure you have the correct phone number.
  236. Jump 40                ! reset modem and try again
  237. !
  238. !**********
  239. -LABEL 84    !---<Line dropped>---
  240. !**********
  241. IncVar 3            ! Increment # dial attempts counter
  242. IfVar 3 4 86        ! if 4 attempts, display Line Dropped Alert
  243. DsplyMsg Carrier signal dropped before network recognition. Retrying ...
  244. Jump 40                ! reset modem and try again
  245. !
  246. !**********
  247. -LABEL 86   !---<Line dropped Err>---
  248. !**********
  249. Bell
  250. Alert 200 Carrier signal dropped before network recognition.\13Try again.
  251. Jump 40                ! reset modem and try again
  252. !
  253. !================================================================================
  254. -LABEL 100    !***<GEIS logon>***
  255. !================================================================================
  256. !
  257. DsplyMsg Physical Connection established. Logging on to network ...
  258. DsplyPic 3
  259. SetVar 3 0            ! clear # dial attempts counter
  260. Wait 6                ! wait 0.1 sec
  261. Flush                ! clear input buffer
  262. !    Note: leave 2 spaces between ~Dist and ~Numb
  263. Xmit ~User,~Dist  ~Numb,~Ridn\13
  264. !
  265. !    Look for one of the following expected responses
  266. MatchStr 1 104 NO CARRIER
  267. MatchStr 2 106 DISCONNECTED
  268. MatchStr 3 120 ===>
  269. MatchStr 6 108 N FAULT,
  270. MatchStr 7 108 T FORMAT,
  271. MatchStr 8 110 L DENIED
  272. MatchStr 9 112 BUSY
  273. MatchStr 10 112 DOWN
  274. Wait 4200            ! wait up to 70 seconds for a response
  275. IncVar 4            ! Increment # logon attempts counter
  276. IfVar 4 3 102        ! if 3 tries, display No Login Response alert 
  277. DsplyMsg No logon response from network. Retrying ...
  278. Jump 40                ! reset modem and try again
  279. !
  280. !*********
  281. -LABEL 102    !---<No Logon response>---
  282. !*********
  283. Bell
  284. Alert 200 No logon response from network.\13Try again.
  285. Jump 40                ! reset modem and try again
  286. !
  287. !*********
  288. -LABEL 104    !---<Carrier dropped>---
  289. !*********
  290. IncVar 4            ! Increment # login attempts counter
  291. IfVar 4 3 105        ! if 3 attempts, display Carrier dropped alert
  292. DsplyMsg Carrier signal dropped during network logon. Retrying ...
  293. Jump 40                ! reset modem and try again
  294. !
  295. !*********
  296. -LABEL 105    !---<Carrier dropped Err>---
  297. !*********
  298. Bell
  299. Alert 200 Carrier signal dropped during network logon.\13Try again.
  300. Jump 40                ! reset modem and try again
  301. !
  302. !*********
  303. -LABEL 106    !---<Session disconnected>---
  304. !*********
  305. IncVar 4            ! Increment # logon attempts counter
  306. IfVar 4 3 107        ! if 3 attempts, display Session disconnected alert
  307. DsplyMsg Network connection dropped during network logon. Retrying ...
  308. Jump 40                ! reset modem and try again
  309. !
  310. !*********
  311. -LABEL 107    !---<Session disconnected Err>---
  312. !*********
  313. Bell
  314. Alert 200 Network connection dropped during network logon.\13Try again.
  315. Jump 40                ! reset modem and try again
  316. !
  317. !*********
  318. -LABEL 108    !---<Validation fault>---
  319. !*********
  320. IncVar 4            ! Increment # logon attempts counter
  321. IfVar 4 3 109        ! see if limit of 3 is exceeded.
  322. DsplyMsg Network rejected your identification. Retrying ...
  323. Wait 60                ! wait 1 sec
  324. Jump 100            ! retry GEIS login (only case where we don't reset)
  325. !
  326. !*********
  327. -LABEL 109    !---<validation fault err>---
  328. !*********
  329. Bell
  330. Alert 200 Your network identification has been rejected.\13Check Setup to make sure your identification is correct.
  331. Jump 40                ! reset modem and try again
  332. !
  333. !*********
  334. -LABEL 110    !---<Denied by host>---
  335. !*********
  336. IncVar 4            ! Increment # logon attempts counter
  337. IfVar 4 3 111        ! if 3 attempts, display Network Problem alert
  338. DsplyMsg Network host equipment problem detected. Retrying ...
  339. Jump 40                ! reset modem and try again
  340. !
  341. !*********
  342. -LABEL 111    !---<Denied by host err>---
  343. !*********
  344. Bell
  345. Alert 200 Network host equipment problem detected.\13Try again.
  346. Jump 40                ! reset modem and try again
  347. !
  348. !*********
  349. -LABEL 112    !---<MARK3K access busy/down>---
  350. !*********
  351. IncVar 4            ! Increment # logon attempts counter
  352. IfVar 4 3 113        ! if 3 attempts, display Network Busy alert
  353. DsplyMsg Network equipment busy/down. Retrying ...
  354. Jump 40                ! reset modem and try again
  355. !
  356. !*********
  357. -LABEL 113    !---<MARK3K access busy/down err>---
  358. !*********
  359. Bell
  360. Alert 200 Network equipment busy or down.\13Try again.
  361. Jump 40                ! reset modem and try again
  362. !
  363. !================================================================================
  364. -LABEL 120    !***<MARK3000 prompt>*** Invoke CICS
  365. !================================================================================
  366. !
  367. DsplyMsg Requesting access to network subsystem ...
  368. DsplyPic 4
  369. Wait 6                ! wait 0.1 secs
  370. Flush                ! clear input buffer
  371. !
  372. Xmit ~CICS\13
  373. !    Look for one of the following expected responses
  374. MatchStr 3 140 READY
  375. !    To overcome a network problem, the following label was changed from 124 to 126
  376. !    MatchStr 4 124 T BOUND
  377. MatchStr 4 126 T BOUND
  378. MatchStr 5 126 UNRECOGN
  379. MatchStr 6 126 ===>
  380. Wait 3600            ! Allow 60 secs for the expected responses to show up
  381. IncVar 5            ! Timeout, so increment # CICS tries counter
  382. IfVar 5 2 122        ! if 3 tries, display No Response alert
  383. DsplyMsg No response to network subsystem request. Retrying ...
  384. Jump 40                ! reset modem and try again
  385. !
  386. !*********
  387. -LABEL 122    !---<No CICS err>---
  388. !*********
  389. Bell
  390. Alert 200 No response to network subsystem request.\13Try again.
  391. Jump 40                ! reset modem and try again
  392. !
  393. !*********
  394. -LABEL 124    !---<Session not bound err>---
  395. !*********
  396. Bell
  397. Alert 200 Network CICS subsystem needs to be started.\13Please contact the Apple USA helpline immediately.
  398. Jump 200            ! jump to cancel routine
  399. !
  400. !*********
  401. -LABEL 126    !---<Invalid application>---
  402. !*********
  403. IncVar 5            ! Increment # CICS tries counter
  404. IfVar 5 3 127        ! if 3 tries, display Invalid Application alert
  405. DsplyMsg Network subsystem request has been rejected. Retrying ...
  406. Wait 60                ! wait 1 sec
  407. Flush
  408. Jump 120            ! try to access CICS again
  409. !
  410. !*********
  411. -LABEL 127    !---<Invalid application err>---
  412. !*********
  413. Bell
  414. Alert 200 The network subsystem request has been rejected.\13Try again.
  415. Flush
  416. Jump 40                ! reset modem and try again
  417. !
  418. !================================================================================
  419. -LABEL 140    !***<CICS ready>*** Start APPM transaction
  420. !================================================================================
  421. !
  422. DsplyMsg Requesting access to distribution center ~Dist ...
  423. DsplyPic 5            ! Highlight box 5 on screen
  424. SetVar 5 0            ! clear # CICS tries counter
  425. !                    ! Send what needs to be sent
  426. Xmit ~Epgm~Dist\13
  427. !    Look for one of the following expected responses
  428. Wait 12                ! wait 0.2 secs
  429. Flush                ! clear input buffer
  430. !    Look for one of the following expected responses
  431. MatchStr 3 160 C100
  432. MatchStr 4 144 INVALID
  433. Wait 3600            ! Allow 60 secs for the expected responses to show up
  434. !
  435. IncVar 6            ! Timeout, so Increment # APPM tries counter
  436. IfVar 6 2 142        ! if 2 tries, display No Transaction alert
  437. DsplyMsg No response to distribution center access request. Retrying ...
  438. Jump 40                ! reset modem and try again
  439. !
  440. !*********
  441. -LABEL 142    !---<No transaction response>---
  442. !*********
  443. Bell
  444. Alert 200 No response to distribution center access.\13Try again.
  445. Jump 40                ! reset modem and try again
  446. !
  447. !*********
  448. -LABEL 144    !---<Invalid transaction>---
  449. !*********
  450. IncVar 6            ! Increment # APPM tries counter
  451. IfVar 6 2 145        ! if 2 tries, display Invalid Transaction alert
  452. DsplyMsg Distribution center access request rejected. Retrying ...
  453. Jump 40                ! reset modem and try again
  454. !
  455. !*********
  456. -LABEL 145    !---<Invalid transaction err>---
  457. !*********
  458. Bell
  459. Alert 200 Distribution center access request rejected.\13Check Setup to make sure your identification is correct.
  460. Jump 40                ! reset modem and try again
  461. !
  462. !================================================================================
  463. -LABEL 160    !***<Online>***
  464. !================================================================================
  465. !
  466. Wait 60                ! wait 1 sec
  467. DsplyMsg Accessing the distribution center ~Dist ...
  468. DsplyPic 6            ! Highlight box 6 on screen
  469. !    C9 = pass msg thru GE, 899 = Echo cmd
  470. Xmit C9899Ole\13
  471. !    Look for one of the following expected responses
  472. MatchStr 2 162 C5
  473. MatchStr 3 170 Ole\13
  474. Wait 7200            ! wait 2 minutes for echo back or distribution center nonavail msg
  475. !
  476. !*********
  477. -LABEL 162    !---<no luck this time>--- 
  478. !*********
  479. DsplyMsg Distribution center is not available ...
  480. Jsr 180                ! terminate session
  481. Bell
  482. Alert -1 Distribution center is not available.\13Please try again later.
  483. Jump 200            ! exit to Cancel routine
  484. !
  485. !*********
  486. -LABEL 170    !---<Success, we’re in, so exit>--- 
  487. !*********
  488. Wait 30                ! wait 0.5 secs
  489. Flush                ! clear input buffer
  490. Exit 0                ! exit the script normally
  491. !
  492. !================================================================================
  493. -LABEL 180-199    !***<Terminate Session>***
  494. !================================================================================
  495. !
  496. !*********
  497. -LABEL 180    !---<Terminate session>--- 
  498. !*********
  499. !    send Abnormal disconnect command
  500. Xmit C3\13
  501. !    Look for one of the following expected responses
  502. MatchStr 1 182 U#
  503. Wait 300            ! wait 5 secs
  504. Return
  505. !
  506. !*********
  507. -LABEL 182    !---<Say bye>---
  508. !*********
  509. Wait 6                ! wait 0.1 sec and sign off the network
  510. Xmit BYE\13
  511. Return
  512. !
  513. !================================================================================
  514. -LABEL 200    !***<Cancel Routine>***
  515. !================================================================================
  516. DsplyMsg Canceling ...
  517. Flush
  518. Wait 30                ! wait 0.5 secs
  519. Exit -1                ! exit the script with an error
  520. !
  521. !================================================================================
  522. -LABEL 210    !***<Hang up phone Routine>***
  523. !================================================================================
  524. !
  525. !    Look for one of the following expected responses
  526. MatchStr 1 222 CARRIER
  527. SetVar 1 0            ! clear # hangup tries counter
  528. SetVar 2 0            ! clear # modem config tries counter
  529. !
  530. !*********
  531. -LABEL 220    !---<Hang up the phone subroutine>---
  532. !*********
  533. Wait 60                ! wait 1 sec (beginning guard time) and send +++ (escape)
  534. Xmit +
  535. Xmit +
  536. Xmit +
  537. Wait 60                ! wait 1 more sec (end guard time)
  538. Flush                ! clear input buffer and tell modem to hang up verbosely
  539. Xmit ATV1H\13
  540. !    Look for one of the following expected responses
  541. MatchStr 2 222 OK
  542. MatchStr 3 224 ERROR
  543. Wait 120            ! wait 2 secs
  544. Jump 224            ! test for error or no response            
  545. !
  546. !*********
  547. -LABEL 222    !---<Reset the modem>---
  548. !*********
  549. !
  550. IfVar 7 0 229        ! If NOT disconnecting, bypass the modem reset.
  551. !                      This aids in script debugging so we dont reset modem 1st time.
  552. Flush                ! Flush the buffer and send Hayes Reset Modem command
  553. Xmit ATZ\13
  554. !    Look for one of the following expected responses
  555. MatchStr 2 229 OK
  556. MatchStr 3 224 ERROR
  557. Wait 180            ! wait 3 secs
  558. !
  559. !*********
  560. -LABEL 224    !---<Error or just no response>---
  561. !*********
  562. IncVar 1            ! Increment # hangup tries counter
  563. IfVar 1 3 225        ! if 3 tries, display error alert and try again
  564. Jump 220            ! try to hangup again
  565. !
  566. !*********
  567. -LABEL 225    !---<Error>---
  568. !*********
  569. IfVar 7 1 229        ! If disconnecting, just return.
  570. Alert 200 The modem is not responding to the hangup command.\13Turn it off and then on again before retrying.
  571. SetVar 1 0            ! clear # hangup tries counter
  572. Jump 220            ! try to hangup again
  573. !
  574. !*********
  575. -LABEL 229    !---<Return from the Hangup sequence>---
  576. !*********
  577. Wait 60                ! wait 1 sec
  578. Flush                ! clear input buffer
  579. Return
  580. !
  581. !================================================================================
  582. -LABEL 230-239    !***<UNUSED>***
  583. !================================================================================
  584. !
  585. !================================================================================
  586. -LABEL 240    !***<Disconnection Sequence>***
  587. !================================================================================
  588. !
  589. !    If the connection is closed, we cant hangup, so just exit
  590. !    CTBIFCLOSED <LabelToGotoIfConnectionClosed>
  591. CTBIFCLOSED 246
  592. !
  593. SetVar 7 1            ! We're disconnecting, so set the flag
  594. !    Look for one of the following expected responses
  595. MatchStr 1 242 U#
  596. MatchStr 2 244 NO CARRIER
  597. Wait 60                ! wait 1 sec
  598. Jump 244            ! and hang up the phone
  599. !
  600. !*********
  601. -LABEL 242    !---<Sign off the network>---
  602. !*********
  603. Xmit BYE\13
  604. Wait 120            ! wait 2 secs
  605. !
  606. !*********
  607. -LABEL 244    !---<Hang up the phone>---
  608. !*********
  609. SetVar 1 0            ! clear the # hangup tries counter
  610. Jsr 210                ! Execute the Hang-up subroutine
  611. !    No CTBClose here because the connection is closed externally from the script
  612. !    in case we exited the script with an error before completion.
  613. Flush                ! clear input buffer
  614. Exit 0                ! exit the script normally
  615. !
  616. !*********
  617. -LABEL 246    !---<Connection Was Closed>---
  618. !*********
  619. Flush                ! clear input buffer
  620. Exit 0                ! exit the script normally
  621. ###
  622.